<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>

<!--<form method="post" action="{:U('aliyunoss/curlapi')}" enctype="multipart/form-data">-->
<!--<form method="post" action="http://lumen.dev.com/qiniu/demo" enctype="multipart/form-data">-->
<form method="post" action="http://lumen.dev.com/aliyun/demo" enctype="multipart/form-data">
    <input name="file" type="file"/>
    <input name="method" type="hidden" value="binary"/>
    <input name="bucket" type="hidden" value="app"/>
    <input type="submit" value="上传"/>
</form>

</body>
<script>

$(function(){

    //提交表单
    $('.save').click(function(){
        var formData = new FormData($('form')[0])
        $.ajax({
            data:formData,
            dataType: 'json',
            type: 'post',
            async: false,
            cache: false,
            contentType: false,
            processData: false,
            url: $('form').attr('action'),
            success: function(res){
                alert(res.msg);
            }
        })
    })

})
</script>
</html>